package com.suixun.service.credits.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.suixun.dao.JfOrderMapper;
import com.suixun.dao.credits.OrderDao;
import com.suixun.entity.ext.credits.company.OrderDetails;
import com.suixun.entity.ext.credits.company.OrderPage;
import com.suixun.entity.form.credits.company.OrderPageForm;
import com.suixun.service.credits.OrderService;
import com.suixun.vo.credits.ResponseVo;

/**
 * 积分订单
 * 
 * @author yh
 * @date 2017年12月18日
 */
@Service
public class OrderServiceImpl implements OrderService {
    
    @Autowired
    private JfOrderMapper jfOrderMapper;
    
    @Autowired
    private OrderDao orderDao;
    
    @Override
    public ResponseVo<OrderPage> findPage(OrderPageForm param) {
        Integer total = orderDao.findPageTatal(param);
        List<OrderPage> list = null;
        if (total > 0) {
            list = orderDao.findPage(param);
        }
        return new ResponseVo<>(list, total);
    }
    
    @Override
    public List<OrderDetails> findDetails(Integer id) {
        return orderDao.findDetails(id);
    } 

}
